<template>
	<view class="content columnbox jus wdh-100">
		<view class="info-box columnbox" v-if="info!=''">
			<view class="title">门诊病历</view>
			<view class="l-info ">
				<text class="i-title">病历号：</text>{{info.id}}
			</view>
			<view class="rowbox wdh-100 spb">
				<view class="s-box">
					<text class="i-title">姓名：</text>{{info.name}}
				</view>
				<view class="s-box">
					<text class="i-title">性别：</text>{{info.sex==2?'女':'男'}}
				</view>
			</view>
			<view class="rowbox wdh-100 spb">
				<view class="s-box">
					<text class="i-title">年龄：</text>{{info.age}}
				</view>
				<!-- <view class="s-box">
					<text class="i-title">科室：</text>111
				</view> -->
			</view>
			<view class="l-info line-box">
				<text class="i-title">就诊时间：</text>{{toLocalDate(info.addtime)}}
			</view>
			<!-- <view class="l-info">
				<text class="i-title">主诉：</text>111
			</view> -->
			<view class="l-info">
				<text class="i-title">现病史：</text>{{info.xianbingshi||'无'}}
			</view>
			<view class="l-info">
				<text class="i-title">既往史：</text>{{info.jiwangshi||'无'}}
			</view>
			<!-- 	<view class="l-info">
				<text class="i-title">过敏史：</text>{{info.xianbingshi||'无'}}
			</view> -->
			<view class="l-info">
				<text class="i-title">诊断：</text>{{info.zhenduan}}
			</view>
			<view class="l-info">
				<text class="i-title">处理：</text>{{info.yijian}}
			</view>
		</view>
	</view>
</template>

<script>
	import time from '@/utils/time.js'
	export default {
		data() {
			return {
				id: 0,
				info: ''
			};
		},
		onLoad(options) {
			this.id = options.id * 1
			this.getDetail()
		},
		methods: {
			toLocalDate(v) {
				return time.toLocalDate(v)
			},
			getDetail() {
				this.$req.post('/doctor/bingliinfo', {
					id: this.id
				}).then(res => {
					this.info = res.data.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		min-height: 100vh;
		background: #F5F8FB;
		font-family: PingFang SC;
	}

	.info-box {
		width: 710rpx;
		margin-top: 20rpx;
		background: #fff;
		padding: 20rpx;
		border-radius: 10rpx;
	}

	.title {
		font-size: 32rpx;
		font-weight: bold;
		margin-bottom: 40rpx;
	}

	.l-info {
		width: 100%;
		font-size: 28rpx;
		padding: 20rpx 0;
		box-sizing: border-box;
	}

	.s-box {
		width: 50%;
		font-size: 28rpx;
		padding: 20rpx 0;
		box-sizing: border-box;
	}

	.i-title {
		font-weight: bold;
	}

	.line-box {
		border-bottom: #F5F8FB solid 1px;
	}
</style>